package com.l.web.master.system.config;

import org.l.qiao.AbstractCollectionDAO;
import org.l.qiao.Cluster;
import org.l.qiao.builder.Query;
import org.springframework.stereotype.Repository;

@Repository
public class ConfigDAO extends AbstractCollectionDAO {

    public static final String COLLECTION = "c_config";

    public ConfigDAO() {
        super(COLLECTION);
    }

    public Config getConfig(String key) {
        Query query = new Query(Config.KEY, key);
        Cluster cluster = findOne(query);
        return new Config(cluster);
    }
}
